//
//  ByFootBallWayTimesView.m
//  caipiao_ios
//
//  Created by mc on 2018/8/4.
//  Copyright © 2018年 ZhangZhanbin. All rights reserved.
//

#import "ByFootBallWayTimesView.h"



@implementation ByFootBallWayTimesView

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        
        UIView *playView = [[UIView alloc] init];
        [self addSubview:playView];
        [playView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(15);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(85, 20));
        }];
        
        UILabel *playLabel = [[UILabel alloc] init];
        [playView addSubview:playLabel];
        [playLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(playView).offset(0);
            make.top.equalTo(playView).offset(0);
            make.bottom.equalTo(playView).offset(0);
            make.right.equalTo(playView).offset(-20);
        }];
        playLabel.font = FONT(14);
        playLabel.text = @"过关方式";
        playLabel.textColor = BY_TEXT_COLOR;
        
        UIImageView *imageView = [[UIImageView alloc] init];
        [playView addSubview:imageView];
        [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(playLabel.mas_right).offset(0);
            make.centerY.equalTo(playView).offset(0);
            make.size.mas_equalTo(CGSizeMake(15, 15));
        }];
        imageView.image = [UIImage imageNamed:@"guoguanfangshi箭头"];
        imageView.userInteractionEnabled = YES;
        
        
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(playWayAction:)];
        [playView addGestureRecognizer:tap];
        playView.userInteractionEnabled = YES;
        
        
        BySuperLottoAddMinusView *addMinusView = [[BySuperLottoAddMinusView alloc] init];
        [self addSubview:addMinusView];
        [addMinusView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-10);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(150, 50));
        }];
        addMinusView.buyLabel.text = @"买";
        addMinusView.timesLabel.text = @"倍";
        self.addMinusView = addMinusView;
        
        UILabel *line = [[UILabel alloc] init];
        [self addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(0);
            make.right.equalTo(self).offset(0);
            make.bottom.equalTo(self).offset(0);
            make.height.mas_equalTo(@1);
        }];
        line.backgroundColor  = BY_LINE_COLOR;
    }
    return self;
}


- (void)playWayAction:(UITapGestureRecognizer *)tap{
    if (self.playWayBlock) {
        self.playWayBlock();
    }
    
}

@end
